bitkeeper revision 1.1327.1.8 (4271171bkgG2OW7a1JXLin4JRIi6_Q)
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 28 Apr 2005 17:02:19 +0000 (17:02 +0000)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 28 Apr 2005 17:02:19 +0000 (17:02 +0000)
Code cleanup

xen/arch/ia64/patch/linux-2.6.11/head.S
xen/arch/ia64/tools/mkbuildtree
xen/arch/ia64/xenmisc.c
xen/arch/ia64/xensetup.c
xen/include/asm-ia64/config.h

index cb98c3ee89819ed650d27e2d6298e9732db0dff0..7cb47a60b807382654244d3c37a633a72327bba2 100644 (file)
@@ -1,20 +1,6 @@
- head.S |   34 ++++++++++++++++++++++++++++++++++
- 1 files changed, 34 insertions(+)
-
-Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S
-===================================================================
---- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/head.S 2005-04-07 10:56:19.225128582 -0500
-+++ linux-2.6.11-xendiffs/arch/ia64/kernel/head.S      2005-04-07 11:00:21.718513399 -0500
-@@ -1,3 +1,8 @@
-+#ifdef XEN
-+#define       console_print   printf
-+#define kernel_thread_helper 0
-+#define sys_exit 0
-+#endif
- /*
-  * Here is where the ball gets rolling as far as the kernel is concerned.
-  * When control is transferred to _start, the bootload has already
-@@ -187,7 +192,11 @@ start_ap:
+--- ../../linux-2.6.11/arch/ia64/kernel/head.S 2005-03-02 00:38:13.000000000 -0700
++++ arch/ia64/head.S   2005-04-28 10:51:19.000000000 -0600
+@@ -187,7 +187,11 @@
        dep r18=0,r3,0,12
        ;;
        or r18=r17,r18
@@ -26,7 +12,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S
        ;;
        mov r17=rr[r2]
        shr.u r16=r3,IA64_GRANULE_SHIFT
-@@ -227,7 +236,11 @@ start_ap:
+@@ -227,7 +231,11 @@
        ;;
        mov ar.rsc=0x3          // place RSE in eager mode
  
@@ -38,29 +24,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S
  (isBP)        movl r2=ia64_boot_param
        ;;
  (isBP)        st8 [r2]=r28            // save the address of the boot param area passed by the bootloader
-@@ -245,7 +258,21 @@ start_ap:
-       br.call.sptk.many rp=sys_fw_init
- .ret1:
- #endif
-+#ifdef XEN
-+      alloc r2=ar.pfs,8,0,2,0
-+      ;;
-+#define fake_mbi_magic 0
-+#define MULTIBOOT_INFO_SIZE   1024
-+      .rodata
-+fake_mbi:
-+      .skip MULTIBOOT_INFO_SIZE
-+      .previous
-+      movl out0=fake_mbi
-+      ;;
-+      br.call.sptk.many rp=cmain
-+#else
-       br.call.sptk.many rp=start_kernel
-+#endif
- .ret2:        addl r3=@ltoff(halt_msg),gp
-       ;;
-       alloc r2=ar.pfs,8,0,2,0
-@@ -254,7 +281,9 @@ start_ap:
+@@ -254,7 +262,9 @@
        br.call.sptk.many b0=console_print
  
  self: hint @pause
@@ -70,13 +34,12 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S
  END(_start)
  
  GLOBAL_ENTRY(ia64_save_debug_regs)
-@@ -850,7 +879,12 @@ END(ia64_delay_loop)
+@@ -850,7 +860,11 @@
   * intermediate precision so that we can produce a full 64-bit result.
   */
  GLOBAL_ENTRY(sched_clock)
 +#ifdef XEN
-+      break 0;;       // FIX IA64_CPUINFO_NSEC_PER_CYC_OFFSET
-+      //movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
++      movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
 +#else
        addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
 +#endif
index 55dd82066d0b6f867e1c0f8fcaf20159cf935a6e..6ff9b80a95875c0e291f6c267c794debfece8dd0 100644 (file)
@@ -97,7 +97,8 @@ cp_patch arch/ia64/kernel/vmlinux.lds.S arch/ia64/xen.lds.S lds.S
 #cp_patch mm/slab.c arch/ia64/slab.c slab.c
 
 # following renamed to avoid conflict
-cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c
+#cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c
+softlink kernel/extable.c arch/ia64/linuxextable.c
 
 cp_patch arch/ia64/mm/contig.c arch/ia64/mm_contig.c mm_contig.c
 cp_patch arch/ia64/mm/tlb.c arch/ia64/tlb.c tlb.c
@@ -168,7 +169,8 @@ softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h vml
 
 cp_patch arch/ia64/hp/sim/hpsim_ssc.h include/asm-ia64/hpsim_ssc.h hpsim_ssc.h
 
-cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h
+#cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h
+softlink include/asm-ia64/current.h include/asm-ia64/current.h
 #cp_patch include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h gcc_intrin.h
 softlink include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h
 cp_patch include/asm-ia64/hardirq.h include/asm-ia64/hardirq.h hardirq.h
@@ -180,7 +182,8 @@ cp_patch include/asm-ia64/irq.h include/asm-ia64/irq.h irq.h
 cp_patch include/asm-ia64/kregs.h include/asm-ia64/kregs.h kregs.h
 cp_patch include/asm-ia64/page.h include/asm-ia64/page.h page.h
 cp_patch include/asm-ia64/processor.h include/asm-ia64/processor.h processor.h
-cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h
+#cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h
+softlink include/asm-ia64/sal.h include/asm-ia64/sal.h
 cp_patch include/asm-ia64/system.h include/asm-ia64/system.h system.h
 cp_patch include/asm-ia64/types.h include/asm-ia64/types.h types.h
 
@@ -268,9 +271,10 @@ cp_patch include/linux/hardirq.h include/asm-ia64/linux/hardirq.h linuxhardirq.h
 cp_patch include/linux/interrupt.h include/asm-ia64/linux/interrupt.h interrupt.h
 cp_patch include/linux/mmzone.h include/asm-ia64/linux/mmzone.h mmzone.h
 
-cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h
+#cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h
+softlink include/linux/wait.h include/asm-ia64/linux/wait.h
 
-cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h
+#cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h
 
 # following renamed to avoid conflict
 cp_patch include/linux/time.h include/xen/linuxtime.h linuxtime.h
index 382def35c16b7e4e60d735aa85aa54272282923e..16668ed49d9777f9d9b03a91170a01a93fc673b5 100644 (file)
@@ -237,18 +237,35 @@ void physdev_destroy_state(struct domain *d)
        dummy();
 }
 
-// accomodate linux extable.c
-//const struct exception_table_entry *
-void *search_module_extables(unsigned long addr)
+///////////////////////////////
+// called from arch/ia64/head.S
+///////////////////////////////
+
+void console_print(char *msg)
 {
-       return NULL;
+       printk("console_print called, how did start_kernel return???\n");
 }
 
-void *module_text_address(unsigned long addr)
+void kernel_thread_helper(void)
 {
-       return NULL;
+       printk("kernel_thread_helper not implemented\n");
+       dummy();
 }
 
+void sys_exit(void)
+{
+       printk("sys_exit not implemented\n");
+       dummy();
+}
+
+
+
+// accomodate linux extable.c
+//const struct exception_table_entry *
+void *search_module_extables(unsigned long addr) { return NULL; }
+void *__module_text_address(unsigned long addr) { return NULL; }
+void *module_text_address(unsigned long addr) { return NULL; }
+
 void cs10foo(void) {}
 void cs01foo(void) {}
 
index 466e4ec629eb5ee7427bc3d62adaa690a8853160..a15b754d683f09c23ce5738a2682aae314d786fc 100644 (file)
@@ -1,13 +1,9 @@
 /******************************************************************************
- * kernel.c
- * 
- * This file should contain architecture-independent bootstrap and low-level
- * help routines. It's a bit x86/PC specific right now!
- * 
- * Copyright (c) 2002-2003 K A Fraser
+ * xensetup.c
+ * Copyright (c) 2004-2005  Hewlett-Packard Co
+ *         Dan Magenheimer <dan.magenheimer@hp.com>
  */
 
-//#include <stdarg.h>
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 //#include <xen/console.h>
 //#include <xen/serial.h>
 #include <xen/trace.h>
-//#include <asm/shadow.h>
-//#include <asm/io.h>
-//#include <asm/uaccess.h>
-//#include <asm/domain_page.h>
-//#include <public/dom0_ops.h>
 #include <asm/meminit.h>
 #include <asm/page.h>
 
@@ -84,7 +75,7 @@ char opt_physdev_dom0_hide[200] = "";
 char opt_leveltrigger[30] = "", opt_edgetrigger[30] = "";
 /*
  * opt_xenheap_megabytes: Size of Xen heap in megabytes, including:
- *     xen image
+ *     xen image
  *     bootmap bits
  *     xen heap
  * Note: To allow xenheap size configurable, the prerequisite is
@@ -147,10 +138,9 @@ static void __init do_initcalls(void)
         (*call)();
 }
 
-void cmain(multiboot_info_t *mbi)
+void start_kernel(void)
 {
     unsigned char *cmdline;
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
     void *heap_start;
     int i;
     unsigned long max_mem, nr_pages, firsthole_start;
@@ -162,7 +152,8 @@ void cmain(multiboot_info_t *mbi)
     xen_pstart = ia64_tpa(KERNEL_START);
 
     /* Must do this early -- e.g., spinlocks rely on get_current(). */
-    set_current(&idle0_exec_domain);
+    //set_current(&idle0_exec_domain);
+    ia64_r13 = (void *)&idle0_exec_domain;
     idle0_exec_domain.domain = &idle0_domain;
 
     early_setup_arch(&cmdline);
@@ -170,7 +161,7 @@ void cmain(multiboot_info_t *mbi)
     /* We initialise the serial devices very early so we can get debugging. */
     serial_init_stage1();
 
-    init_console(); 
+    init_console();
     set_printk_prefix("(XEN) ");
 
     /* xenheap should be in same TR-covered range with xen image */
@@ -201,7 +192,7 @@ void cmain(multiboot_info_t *mbi)
           ia64_boot_param->initrd_size);
     ia64_boot_param->initrd_start = initial_images_start;
     printk("Done\n");
-    
+
     /* first find highest page frame number */
     max_page = 0;
     efi_memmap_walk(find_max_pfn, &max_page);
@@ -217,7 +208,7 @@ void cmain(multiboot_info_t *mbi)
     efi_memmap_walk(filter_rsvd_memory, init_boot_pages);
     efi_memmap_walk(xen_count_pages, &nr_pages);
 
-    printk("System RAM: %luMB (%lukB)\n", 
+    printk("System RAM: %luMB (%lukB)\n",
        nr_pages >> (20 - PAGE_SHIFT),
        nr_pages << (PAGE_SHIFT - 10));
 
@@ -267,7 +258,7 @@ printk("About to call init_idle_task()\n");
     {
     int i;
     for (i = 0; i < CLONE_DOMAIN0; i++) {
-       clones[i] = do_createdomain(i+1, 0);
+       clones[i] = do_createdomain(i+1, 0);
         if ( clones[i] == NULL )
             panic("Error creating domain0 clone %d\n",i);
     }
@@ -278,9 +269,6 @@ printk("About to call init_idle_task()\n");
 
     set_bit(DF_PRIVILEGED, &dom0->d_flags);
 
-//printk("About to call shadow_mode_init()\n");
-//    shadow_mode_init();
-
     /*
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
index 2b3d017cf96a9c0fb9b21da62a20c8cf610e667e..1c34f409991c820febaa4025e13644caea046058 100644 (file)
@@ -116,6 +116,9 @@ struct page;
 // avoid redefining task_t in asm/thread_info.h
 #define task_t struct domain
 
+// avoid redefining task_struct in asm/current.h
+#define task_struct exec_domain
+
 // linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c)
 #define platform_inb   __ia64_inb
 #define platform_inw   __ia64_inw
@@ -177,8 +180,6 @@ struct pci_bus_region {
        unsigned long end;
 };
 
-// from linux/include/linux/module.h
-
 // warning: unless search_extable is declared, the return value gets
 // truncated to 32-bits, causing a very strange error in privop handling
 struct exception_table_entry;
@@ -232,7 +233,9 @@ void sort_main_extable(void);
 
 #define ARCH_HAS_EXEC_DOMAIN_MM_PTR
 
-// see arch/x86/nmi.c !?!?
+// from include/linux/preempt.h (needs including from interrupt.h or smp.h)
+#define preempt_enable()       do { } while (0)
+#define preempt_disable()      do { } while (0)
 
 // these declarations got moved at some point, find a better place for them
 extern int opt_noht;